// PANNEAU RECHERCHE $('.fw.fa-search').click(function(){ $('#recherche').fadeIn(100); }); $(document).keypress(function(e){ if(e.which == 27){ $('#recherche').fadeOut(100); } }); $('.closeSearch').click(function(){ $('#recherche').fadeOut(100); }); // FIN PANNEAU RECHERCHE /* PANNEAU AGENDA */ $('#agendaButton').click(function(){ $('#agenda').slideToggle(); }); /* MAIN MENU */ $('.catItem').hover(function(){ $('.subCat').hide(); $(this).children('.subCat').fadeIn(100); }); $('.catItem').mouseleave(function(){ $('.subCat').fadeOut(100); }); // FIN GALERIE ARTICLE // FILTRES PAGE ARCHIVE // FONCTION HASHFILTER function getHashFilter() { var hash = location.hash; var matches = location.hash.match( /filter=([^&]+)/i ); var hashFilter = matches && matches[1]; return hashFilter && decodeURIComponent( hashFilter ); } // MISE EN FORME VIDEO SUR PAGE D'ARTICLE var container = document.getElementById('embed_container'); var video = document.getElementById('video'); var ratio = 9/16; //this is why the 56.25% padding hack exists function resizer() { var width = parseInt(window.getComputedStyle(container)['width'], 10); var height = (width * ratio); video.style.width = width + 'px'; video.style.height = height + 'px'; video.style.marginTop = '-3.278%'; //~732px wide, the video border is about 24px thick (24/732) container.style.height = (height * 0.88) + 'px'; //0.88 was the magic number that you needed to shrink the height of the outer container with. } //attach event on resize window.addEventListener('resize', resizer, false); //call function for initial sizing //no need for padding hack since we are setting the height based off of the width * aspect ratio resizer(); //container.style.padding = 0; // FIN MISE EN FORME VIDEO SUR PAGE D'ARTICLE